From: Sam Reed Date: Tue, 30 Nov 2010 19:38:04 +0000 (+0000) Subject: Remove some redundant character escapes from regexes X-Git-Tag: 1.31.0-rc.0~33668 X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=commitdiff_plain;h=5437c40e1dc4fb44bda58d8f10e717081679e2a4;p=lhc%2Fweb%2Fwiklou.git Remove some redundant character escapes from regexes --- diff --git a/resources/jquery.effects/jquery.effects.core.js b/resources/jquery.effects/jquery.effects.core.js index f3041f569f..4589fe2110 100644 --- a/resources/jquery.effects/jquery.effects.core.js +++ b/resources/jquery.effects/jquery.effects.core.js @@ -52,7 +52,7 @@ function getRGB(color) { return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; // Look for rgb(num%,num%,num%) - if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; // Look for #a0b1c2 diff --git a/resources/jquery/jquery.color.js b/resources/jquery/jquery.color.js index 634719d37f..e1b0d0dd89 100644 --- a/resources/jquery/jquery.color.js +++ b/resources/jquery/jquery.color.js @@ -39,7 +39,7 @@ return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; // Look for rgb(num%,num%,num%) - if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; // Look for #a0b1c2 diff --git a/skins/common/ajaxwatch.js b/skins/common/ajaxwatch.js index a1682f084c..aaf6360cef 100644 --- a/skins/common/ajaxwatch.js +++ b/skins/common/ajaxwatch.js @@ -65,8 +65,8 @@ $( document ).ready( function() { var $link = $( this ); $link .data( 'icon', $link.parents( 'li' ).hasClass( 'icon' ) ) - .data( 'action', $link.attr( 'href' ).match( /[\?\&]action=unwatch/i ) ? 'unwatch' : 'watch' ); - var title = $link.attr( 'href' ).match( /[\?\&]title=(.*?)&/i )[1]; + .data( 'action', $link.attr( 'href' ).match( /[\?&]action=unwatch/i ) ? 'unwatch' : 'watch' ); + var title = $link.attr( 'href' ).match( /[\?&]title=(.*?)&/i )[1]; $link.data( 'target', decodeURIComponent( title ).replace( /_/g, ' ' ) ); });